package fr.curriculumvitae.anthony.stephan.objects;

import java.io.Serializable;
import java.util.Date;

public class Message implements Serializable {
	
	private static final long serialVersionUID = 770104019539780142L;
	
	public static final String PARSE_OBJECT_MESSAGE = "Message";
	public static final String PARSE_FIELD_OBJECT_ID = "objectId";
	public static final String PARSE_FIELD_CREATEDAT = "createdAt";
	public static final String PARSE_FIELD_NAME = "name";
	public static final String PARSE_FIELD_FUNCTION = "function";
	public static final String PARSE_FIELD_ENTERPRISE = "enterprise";
	public static final String PARSE_FIELD_EMAIL = "mail";
	public static final String PARSE_FIELD_PHONE = "phone";
	public static final String PARSE_FIELD_MESSAGE = "message";
	public static final String PARSE_FIELD_READ = "read";
	
	private static final String EMPTY = "";
	
	private String objectId = null;
	private Date createdAt = null;
	private String name = EMPTY;
	private String function = EMPTY;
	private String enterprise = EMPTY;
	private String email = EMPTY;
	private String phone = EMPTY;
	private String message = EMPTY;
	private boolean read = false;
	
	public Message() {
		this.objectId = null;
		this.createdAt = null;
		this.name = EMPTY;
		this.function = EMPTY;
		this.enterprise = EMPTY;
		this.email = EMPTY;
		this.phone = EMPTY;
		this.message = EMPTY;
		this.read = false;
	}
	
	public Message(String objectId, Date createdAt, String name, String function, String enterprise, String email, String phone, String message, boolean read) {
		this.objectId = objectId;
		this.createdAt = createdAt;
		this.name = name;
		this.function = function;
		this.enterprise = enterprise;
		this.email = email;
		this.phone = phone;
		this.message = message;
		this.read = read;
	}
	
	public String getObjectId() {
		return objectId;
	}

	public void setObjectId(String objectId) {
		this.objectId = objectId;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public String getName() {
		return name != null ? name : EMPTY;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFunction() {
		return function != null ? function : EMPTY;
	}

	public void setFunction(String function) {
		this.function = function;
	}

	public String getEnterprise() {
		return enterprise != null ? enterprise : EMPTY;
	}

	public void setEnterprise(String enterprise) {
		this.enterprise = enterprise;
	}

	public String getEmail() {
		return email != null ? email : EMPTY;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone != null ? phone : EMPTY;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMessage() {
		return message != null ? message : EMPTY;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isRead() {
		return read;
	}

	public void setRead(boolean read) {
		this.read = read;
	}

	@Override
	public String toString() {
		return "Message [objectId=" + objectId + ", createdAt=" + createdAt
				+ ", name=" + name + ", function=" + function + ", enterprise="
				+ enterprise + ", email=" + email + ", phone=" + phone
				+ ", message=" + message + ", read=" + read + "]";
	}

}
